package com.kgis.fm.common.event
{
	import flash.events.Event;
	
	[Response(name="{RETURN_ID}", type="com.kgis.mvc.CommandCompletionEvent")]
	/**
	 * 从服务端货物osp的GM元数据
	 * @author zhxiaomiao
	 * */
	public class AddGeometryEvent extends Event {
		
		public static const REQUEST_ID:String = "AddGeometryEvent_Request";
		public static const RETURN_ID:String = "AddGeometryEvent_Return";
		
		//已有entity基础上，仅新增图形
		public static const TYPE_ADD_GEOMETRY_ONLY:int = 1;
		//新增图形结束
		public static const TYPE_ADD_GEOMETRY_END:int = 2;
		
		private var _actionType:int = TYPE_ADD_GEOMETRY_ONLY;
		private var _spec:Object = null;
		
		public function AddGeometryEvent(spec:Object, actionType:int = TYPE_ADD_GEOMETRY_ONLY, type:String = null) {
			var typeId:String = type;
			if (type == null) {
				typeId = REQUEST_ID;
			}
			super(typeId);
			_spec = spec;
			_actionType = actionType;
		}
		
		public override function clone():Event {
			var event:AddGeometryEvent = new AddGeometryEvent(spec, actionType, type);
			return event;
		}
		
		public function get spec():Object {
			return _spec;
		}
		
		public function get actionType():int {
			return _actionType;
		}
	}
}